﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using FancyBattles.GameAudio;

namespace FancyBattles.GameScreen
{
    public enum UpdateResponse
    {
        CLOSE_SCREEN,
        KEEP_STATE,
        PAUSE_GAME,
        EXIT_GAME,
        ERROR
    }

    class GameScreen
    {
        #region Atributes

        private ScreenManager screenManager;
        private AudioManager audioManager;
        private ContentManager contentManager;

        #endregion

        #region Properties

        public ScreenManager ScreenManager
        {
            internal get { return screenManager; }
            set { screenManager = value; }
        }

        public AudioManager AudioManager
        {
            internal get { return audioManager; }
            set { audioManager = value; }
        }

        protected SpriteBatch SpriteBatch
        {
            get { return screenManager.SpriteBatch; }
        }

        protected ContentManager ContentManager
        {
            get { return contentManager; }
        }

        #endregion

        #region Creators
        #endregion

        #region Methods

        public virtual void LoadContent()
        {
            if (contentManager == null)
            {
                contentManager = new ContentManager(screenManager.Game.Services, "Content");
            }
            if (audioManager == null)
            {
                audioManager = new AudioManager(screenManager.Game); 
            }
        }

        public virtual void UnloadContent() { }

        public virtual void Draw(GameTime gameTime) { }

        public virtual UpdateResponse Update(GameTime gameTime)
        {
            return UpdateResponse.KEEP_STATE;
        }

        #endregion
    }
}
